package com.tujh.android.designpatterns.Prototype;

/**
 * Created by TUJH on 2016/10/25.
 */
public class Teacher implements Cloneable {

    private String teacherName;
    private int teacherNum;
    private Student student;

    public Teacher(String teacherName, int teacherNum) {
        this.teacherName = teacherName;
        this.teacherNum = teacherNum;
    }

    public Teacher(String teacherName, int teacherNum, Student student) {
        this.teacherName = teacherName;
        this.teacherNum = teacherNum;
        this.student = student;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public int getTeacherNum() {
        return teacherNum;
    }

    public void setTeacherNum(int teacherNum) {
        this.teacherNum = teacherNum;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    @Override
    public Object clone() {
        try {
            Teacher t = (Teacher) super.clone();
            t.setStudent((Student) student.clone());
            return t;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }


}
